package com.gem.netty.service.nobility;

import com.gem.entity.Nobility;
import com.gem.enums.ClientMessageType;
import com.gem.enums.MessageColorType;
import com.gem.netty.entity.ClientContent;
import com.gem.pipeline.BusinessProcess;
import com.gem.pipeline.ProcessContext;
import com.gem.utils.R;

/**
 * Author: Xhy
 * CreateTime: 2022-10-02 15:28
 */
public class GetNobilityVerifyService implements BusinessProcess<ClientContent> {
    @Override
    public void process(ProcessContext<ClientContent> context) {
        Nobility nobility = context.getData().getContent().getNobility();
        if (nobility == null){
            context.setResult(R.error().data("color", MessageColorType.SYSTEM_MESSAGE.type).message("非法操作").type(ClientMessageType.GET_GEM.type));
            context.setNeedBreak(true);
        }
    }
}
